import utils from "../utils";

const USER_STR = 'PHQ_SYSTEM_USER';

export default class User {
    public Get(): any {
        const val = sessionStorage.getItem(USER_STR);
        return utils.empty(val) ? { account: {}, user: {} } : JSON.parse(val as string);
    }
    public Set(val: any) {
        if (!utils.empty(val)) {
            sessionStorage.setItem(USER_STR, JSON.stringify(val));
        }
    }
    public Remove() {
        sessionStorage.removeItem(USER_STR);
    }
}
